# coding=utf-8
# 本题为考试多行输入输出规范示例，无需提交，不计分。
import sys

def myfunc(num,thre,count,sugar_list):
    if num < count:
        return 0
    res = 0
    l = 0
    r = 0
    while r < num:
        if sugar_list[r] <= thre:
            if r - l == count -1:
                l += 1
                res += 1
            r += 1
        else:
            r += 1
            l = r
    return res


if __name__ == "__main__":
    # 读取第一行的n
    # n = int(sys.stdin.readline().strip())
    values = []
    for i in range(2):
        # 读取每一行
        line = sys.stdin.readline().strip()
        # 把每一行的数字分隔后转化成int列表
        value = list(map(int, line.split()))
        values.append(value)
    num_sugar = values[0][0]
    threshold = values[0][1]
    count = values[0][2]
    sugar_list = values[1]

    res = myfunc(num_sugar,threshold,count,sugar_list)
    print(res)
